#ifndef VIEWMANAGER_H
#define VIEWMANAGER_H

#include <QObject>
#include <QSize>


#include "pcchild.h"


class QScrollArea;
class QScrollBar;

class TimeAxis;
class GanttView;
class GanttScene;
class GanttRuler;
class TaskTreeView;


class ViewManager : public QObject, public PCChild
{
    Q_OBJECT
public:
    explicit ViewManager(ProCycle *app,
                         GanttView *gv,
                         GanttScene *gs,
                         GanttRuler *ruler,
                         QScrollArea *rsa,
                         TaskTreeView *ttv,
                         QScrollBar *vsb);


    void initSizePolicy();

    TimeAxis *axis() const;

    QSize minSize() const {
        return m_minSize;
    }



public slots:

    void processGanttViewResize(QSize newSize);
    void resizeScene(QSize newSize);

    void scrollVertical(int scroll);
    void scrollHorizontal(int scroll);
    void rangeVertical(int min, int max);
    void rangeHorizontal(int min, int max);

private:
    QSize m_minSize;
    bool m_policyDone;

    GanttView *m_gv;
    GanttScene *m_gs;
    GanttRuler *m_ruler;
    QScrollArea *m_rsa;
    TaskTreeView *m_ttv;
    QScrollBar *m_vsb;
};


#endif // VIEWMANAGER_H
